﻿<ws:ApplicationView x:Class="MultiMasterView.Modules.Core.Main.MainView" 
                    x:ClassModifier="internal"
                    x:TypeArguments="local:IMainViewModel"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:ws="clr-namespace:Creventive.Wpf.ShellFactory.Workspace;assembly=Creventive.Wpf.ShellFactory"
                    xmlns:local="clr-namespace:MultiMasterView.Modules.Core.Main"
                    xmlns:wsp="clr-namespace:Creventive.Wpf.ShellFactory.Workspace.Primitives;assembly=Creventive.Wpf.ShellFactory"
                    mc:Ignorable="d"
                    d:DesignHeight="541" 
                    d:DesignWidth="821" 
                    d:DataContext="{d:DesignInstance local:MainDesignTimeViewModel, IsDesignTimeCreatable=True}">

	<Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="16" />
			<ColumnDefinition Width="*" />
		</Grid.ColumnDefinitions>
		<!-- Create a menu to contain the showable views -->
		<Border Grid.Column="0">
            <!--
			<ItemsControl ItemsSource="{Binding MasterViewSources}">
				<ItemsControl.ItemTemplate>
					<DataTemplate>
						<Button Style="{StaticResource MenuButton}" Margin="8" Command="Open" CommandParameter="{Binding}" CommandTarget="{Binding ElementName=mainWorkspace}" />
					</DataTemplate>
				</ItemsControl.ItemTemplate>
			</ItemsControl>
            -->
		</Border>
		<Border Grid.Column="2">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <ws:WorkspaceTabStrip Workspace="{Binding ElementName=mainWorkspace}" />
                <!-- This is where the views will be presented -->
                <ws:DeckWorkspace x:Name="mainWorkspace" Grid.Row="1" Source="{Binding MasterViewSources}">
                    <ws:DeckWorkspace.ContainerStyle>
                        <Style TargetType="{x:Type wsp:WorkspaceItem}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type wsp:WorkspaceItem}">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="*" />
                                            </Grid.RowDefinitions>
                                            <DockPanel>
                                                <Button HorizontalAlignment="Right" Content="Close" Command="Close" CommandParameter="{TemplateBinding ApplicationView}" DockPanel.Dock="Right" />
                                            </DockPanel>
                                            <Border Grid.Row="1">
                                                <wsp:ApplicationViewPresenter />
                                            </Border>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </ws:DeckWorkspace.ContainerStyle>
                </ws:DeckWorkspace>
            </Grid>
		</Border>
	</Grid>
</ws:ApplicationView>